﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HotShot.Entities;

namespace HotShot.Service.BusinessLogic.MessageProcessors
{
    public class RetrieveProcessor : MessageProcessorBase  
    {
        public override void ProcessMessage(HotShot.Entities.Messages.BaseMessage message, string correlationId)
        {
            var entity = message.XmlPayload.FromXml<StorageEntity>();
            entity = EntityStoreLogic.Current.Get(entity.Key);

            QueueCommunicationLogic.Current.SendInputMessage(message.ReturnAddress, Messages.RetrieveResultInternal(entity, null), correlationId);
        }
    }
}
